package com.example.administrator.ygddriver.set.xy;

import android.content.Intent;
import android.view.View;
import android.widget.LinearLayout;

import com.example.administrator.ygddriver.R;
import com.example.administrator.ygddriver.base.BaseActivity;
import com.example.administrator.ygddriver.message.MessageActivity;
import com.example.administrator.ygddriver.tool.SimpleToolbar;
import com.example.administrator.ygddriver.tool.UrlValuse;
import com.example.administrator.ygddriver.webview.WebActivity;

public class XyActivity extends BaseActivity implements View.OnClickListener {
    private LinearLayout mLl, mLl2, mLl3, mLl4, mLl5;
    private SimpleToolbar simpleToolbar;

    @Override
    public int initLayout() {
        return R.layout.activity_xy;
    }

    @Override
    public void initView() {
        simpleToolbar = findViewById(R.id.activity_xy_stb);
        mLl = findViewById(R.id.activity_xy_ll);
        mLl2 = findViewById(R.id.activity_xy_ll2);
        mLl3 = findViewById(R.id.activity_xy_ll3);
        mLl4 = findViewById(R.id.activity_xy_ll4);
        mLl5 = findViewById(R.id.activity_xy_ll5);
        mLl.setOnClickListener(this);
        mLl2.setOnClickListener(this);
        mLl3.setOnClickListener(this);
        mLl4.setOnClickListener(this);
        mLl5.setOnClickListener(this);
    }

    @Override
    public void initDate() {
        setSimpleToolbar();

    }

    private void setSimpleToolbar() {
        simpleToolbar.setMainTitle("用户协议");
        simpleToolbar.setMainTitleColor("#000000");
        simpleToolbar.setBackIv(R.mipmap.left_title);
        simpleToolbar.setToolColor("#ffffff");
        simpleToolbar.setBackIvClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.activity_xy_ll:
                Intent intent = new Intent(XyActivity.this, WebActivity.class);
                String URL = UrlValuse.DOMAIN_NAME + UrlValuse.XY + "one.html";
                intent.putExtra("URL", URL);
                startActivity(intent);
                break;
            case R.id.activity_xy_ll2:
                Intent intent1 = new Intent(XyActivity.this, WebActivity.class);
                String URL1 = UrlValuse.DOMAIN_NAME + UrlValuse.XY + "two.html";
                intent1.putExtra("URL", URL1);
                startActivity(intent1);

                break;
            case R.id.activity_xy_ll3:
                Intent intent2 = new Intent(XyActivity.this, WebActivity.class);
                String URL2 = UrlValuse.DOMAIN_NAME + UrlValuse.XY + "three.html";
                intent2.putExtra("URL", URL2);
                startActivity(intent2);

                break;
            case R.id.activity_xy_ll4:
                Intent intent3 = new Intent(XyActivity.this, WebActivity.class);
                String URL3 = UrlValuse.DOMAIN_NAME + UrlValuse.XY + "four.html";
                intent3.putExtra("URL", URL3);
                startActivity(intent3);

                break;
            case R.id.activity_xy_ll5:
                Intent intent4 = new Intent(XyActivity.this, WebActivity.class);
                String URL4 = UrlValuse.DOMAIN_NAME + UrlValuse.XY + "five.html";
                intent4.putExtra("URL", URL4);
                startActivity(intent4);

                break;

        }
    }
}
